<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/art-template/4.10.0/lib/template-web.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
</head>
<body>
    <div id="box"></div>
</body>
<script id="lpl" type="text/html">
        <div>我是客户端的模板引擎</div>
        {{each person}}
        {{if $value.age>18}}
        <div>我是{{$value.name}},今年{{$value.age}}了,我已经成年啦</div>
        {{else}}
        <div>我是{{$value.name}},今年{{$value.age}}了,我还未成年呢</div>
        {{/if}}
        {{/each}}
</script>
<script>
    let person=[{name:"马超",age:22},{name:"文文",age:12}]
    let ht=template("lpl",{person})
    document.getElementById("box").innerHTML=ht
</script>
</html>